<?php
namespace core\gateway;

use core\HttpSession;
use core\process\ProcessView;
use core\process\ProcessProperty;
use core\Object;

abstract class AbstractGateway implements Object {

	public static $ACTION_START   	= "actionStart";
	public static $ACTION_REQUEST 	= "actionRequest";
	public static $ACTION_SAVE 	  	= "actionSave";
	public static $ACTION_VIEW    	= "actionView";
	public static $ACTION_DELETE  	= "actionDelete";
	public static $ACTION_REDIRECT	= "actionRedirect";
	public static $ACTION_RETURN	= "actionReturn";

	public static $PROCESS_VIEW		= "processView";
	public static $PROCESS_PROPERTY	= "processProperty";

	public static $EXCUTE_DISPLAY   = "excuteDisplay";
	public static $EXCUTE_DISABLED  = "excuteDisabled";

	private $fileHtml;

	public function AbstractGateway(){}

	protected function setView($fileHtml){
		$this->fileHtml = $fileHtml;
	}

	protected abstract function actionStart(HttpSession $httpSession);

	protected abstract function actionRequest(HttpSession $httpSession);

	protected function actionSave(HttpSession $httpSession){}

	protected function actionView(HttpSession $httpSession){}

	protected function actionDelete(HttpSession $httpSession){}

	private function processView(HttpSession $httpSession){
		new ProcessView($httpSession, $this, $this->fileHtml);
	}

	private function processProperty(HttpSession $httpSession){
		new ProcessProperty($httpSession, $this, $this->fileHtml);
	}

	protected function excuteDisplay($name){
		return true;
	}

	protected function excuteDisabled($name){
		return true;
	}
}
?>